﻿using JamesZhao.Engine.GameObjects;
using JamesZhao.Engine.Graphics;
using JamesZhao.Engine.Graphics.Effects;
using JamesZhao.Engine.Graphics.Visuals;

namespace JamesZhao.Engine.GameComponents
{
    public class TerrainComponent : GameComponent
    {
        private readonly TerrainDrawable _terrainDrawable;
        public TerrainComponent(GameObject owner) : base(owner)
        {
            _terrainDrawable = new TerrainDrawable();
        }
        public Material Material
        {
            get { return _terrainDrawable.Material; }
            set { _terrainDrawable.Material = value; }
        }
        public override void Initialize()
        {
            base.Initialize();
            Owner.Engine.GraphicsManager.VisualsList.AttachDrawable(_terrainDrawable);
        }
    }
}